import {
	request
} from './server.js'

export const login =
	function(params) { //手机号登录
		return request.post('/auth/login', params)
			.then(data => {
				return data.data
			})
	}

export const currentUser =
	function(params) { //根据token获取用户信息
		return request.get('/auth/user')
			.then(data => {
				return data.data
			})
	}
export const logout =
	function(params) { //销毁令牌
		return request.get('/auth/logout')
			.then(data => {
				return data.data
			})
	}
export const sign =
	function(params) { //用户注册
		return request.post('/auth/sign', params)
			.then(data => {
				return data.data
			})
	}
export const updatePwd =
	function(params) { //修改密码
		return request.post('/auth/updatePwd', params)
			.then(data => {
				return data.data
			})
	}
